package com.ssy.mall.exception;
/*
统一异常
 */
public class SsyMallException extends RuntimeException{
    private final Integer code;
    private final String message;
    public SsyMallException(String message,Integer code){
        this.code = code;
        this.message = message;
    }
    public SsyMallException(SsyMallExceptionEnum exceptionEnum){
        this(exceptionEnum.getMsg(), exceptionEnum.getCode());
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
